home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / Core / source / 3d bound.cp next >
Encoding:
Text File  |  1995-03-19  |  2.2 KB  |  45 lines  |  [TEXT/MMCC]

  1. //------------------------------------------------------------------------------
  2. //    File:                    bound3d.cp
  3. //    Date:                    7/20/94
  4. //    Author:                Bretton Wade
  5. //
  6. //    Description:    this file contains the class definition for a 3d bound widget.
  7. //
  8. //------------------------------------------------------------------------------
  9.  
  10. #include    "colors.h"
  11. #include    "3d look.h"
  12. #include    "3d bound.h"
  13.  
  14. //------------------------------------------------------------------------------
  15. //    constructor
  16. //------------------------------------------------------------------------------
  17. bound3d::bound3d (Rect &c1, Rect &c2, bool u) : bound (c1, c2)                                    //    constructor
  18. {                                                                                                                                                                //    begin
  19.     up = u;                                                                                                                                                //    copy the 3d look parameter
  20. }                                                                                                                                                                //    end
  21.  
  22. //------------------------------------------------------------------------------
  23. //    update the widget
  24. //------------------------------------------------------------------------------
  25. void        bound3d::Update (EventRecord &event)                                                                        //    method to draw the widget and all of its children
  26. {                                                                                                                                                                //    begin
  27.     RGBBackColor (&GREY);                                                                                                                    //    set the background color
  28.     EraseRect (&(*region)->rgnBBox);                                                                                            //    erase the frame contents
  29.     RGBBackColor (&WHITE);                                                                                                                //    restore the background color
  30.     widget::Update (event);                                                                                                                //    do what the other widgets do
  31. }                                                                                                                                                                //    end
  32.  
  33. //------------------------------------------------------------------------------
  34. //    draw the widget
  35. //------------------------------------------------------------------------------
  36. void        bound3d::Draw (void)                                                                                                        //    method to draw the widget
  37. {                                                                                                                                                                //    begin
  38.     if (up)                                                                                                                                                //    if the frame is up
  39.         FrameRectUp ((*region)->rgnBBox);                                                                                        //    give the frame a 3d look (up)
  40.     else                                                                                                                                                    //    otherwise
  41.         FrameRectDown ((*region)->rgnBBox);                                                                                    //    give the frame a 3d look (down)
  42. }                                                                                                                                                                //    end
  43.  
  44. //------------------------------------------------------------------------------
  45.